cmake_minimum_required(VERSION 3.13)
project(fsm CXX)

set(CMAKE_CXX_STANDARD 17)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

set(PROJECT_SRC
    src/state_machine.cpp
    src/core/state.cpp
    src/core/repo.cpp
    src/core/event_queue.cpp
    src/core/event_observer.cpp
    src/app/ts_nego/states/ready_nego.cpp
    src/app/ts_nego/states/transition.cpp
    src/app/ts_nego/events/received_cr.cpp
    src/app/ts_nego/events/received_ca.cpp
    src/app/ts_nego/events/received_cmt.cpp)

add_library(${PROJECT_NAME} SHARED ${PROJECT_SRC})

target_include_directories(${PROJECT_NAME} PRIVATE include)
target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads)

add_subdirectory(test)
